import com.dz.glory.common.vo.Page;
import com.dz.glory.common.vo.Ret;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * ${table.comment} Rpc接口 实现类
 * </p>
 *
 * @author ${author}
 * @since ${date?date}
 */
@DubboService
public class ${entity}ServiceRpcImpl implements ${entity}ServiceRpc {

    @Resource
    private ${entity}Service ${entity?uncap_first}Service;

    @Override
    public Ret<Page<${entity}VO>> getList(${entity}Req req) {
        return Ret.success(${entity?uncap_first}Service.getList(req));
    }

    @Override
    public Ret<${entity}VO> getById(Integer id) {
        return Ret.success(${entity?uncap_first}Service.getById(id));
    }

    @Override
    public Ret<List<${entity}VO>> getAll() {
        return Ret.success(${entity?uncap_first}Service.getAll());
    }

    @Override
    public Ret<${entity}VO> saveOrUpdate(${entity}VO vo) {
        return Ret.success(${entity?uncap_first}Service.saveOrUpdate(vo));
    }

    @Override
    public Ret<Boolean> delete(List<Integer> ids) {
        return Ret.success(${entity?uncap_first}Service.delete(ids));
    }

<#list table.fields as field>
    <#if field.propertyName == "sort">
    @Override
    public Ret<Integer> updateSort(${entity}Req req) {
        return Ret.success(${entity?uncap_first}Service.updateSort(req));
    }
    </#if>
    <#if field.propertyName == "status">
    @Override
    public Ret<Integer> updateStatus(${entity}Req req) {
        return Ret.success(${entity?uncap_first}Service.updateStatus(req));
    }
    </#if>
</#list>
}
